package ar.edu.itba.pod.legajo45129.simul.communication.factory;

import java.util.concurrent.TimeUnit;

import ar.edu.itba.pod.simul.communication.AgentDescriptor;
import ar.edu.itba.pod.simul.market.Resource;
import ar.edu.itba.pod.simul.units.Factory;
import ar.edu.itba.pod.simul.units.SimpleConsumer;
import ar.edu.itba.pod.simul.units.SimpleProducer;

public class AgentFactory {
	
	public static AgentDescriptor FactoryAgent(String name, Resource resourceUse, int amountUse, 
			Resource resourceProduce, int amountProduce, int worktime, TimeUnit workUnit) {
		return Factory.named(name)
			.producing(amountUse, resourceUse)
			.using(amountUse, resourceUse)
			.every(worktime, workUnit)
			.build()
			.getAgentDescriptor();
	}
	
	public static AgentDescriptor SimpleProducerAgent(String name, Resource resource, int amount, 
			int workTime, TimeUnit workUnit) {
		return SimpleProducer
			.named(name)
			.producing(amount)
			.every(workTime, workUnit)
			.build()
			.getAgentDescriptor();
		
	}
	
	public static AgentDescriptor SimpleConsumerAgent(String name, Resource resource, int amount,
			int workTime, TimeUnit workUnit) {
		return SimpleConsumer
			.named(name)
			.consuming(amount)
			.of(resource)
			.every(workTime, workUnit)
			.build()
			.getAgentDescriptor();
	}

}
